//this is a main program for testing the Geffe generator

#include <iostream>
#include "geffe.h"

int main(){
  std::cout << "Testing Geffe generator\n";
  //create a Geffe generator
  //l1=2, l2=3, l3=5
  //lfsr1 x^2+x+1
  //lfsr2 x^3+x+1
  //lfsr3 x^5+x^2+1
  Geffe myGen(2,3,5);
  myGen.initPoly(1,word32(3));
  myGen.initPoly(2,word32(3));
  myGen.initPoly(3,word32(5));
  //set the key
  //K=(11,010,01001);
  myGen.initKey(1,3);
  myGen.initKey(2,2);
  myGen.initKey(3,9);
  //generate 32 symbols
  for(int i=0;i<32;i++){
    int z=myGen.generateKeyStream();
    std::cout << z ;
  }
  std::cout << std::endl;
  //run it again but generate 32 bit in one chunk
  myGen.initKey(1,3);
  myGen.initKey(2,2);
  myGen.initKey(3,9);
  word32 keystream=myGen.generateKeyStream32();
  std::cout << keystream.toBinStringLSB() << std::endl;
}
